# $(BIN) est la nom du binaire genere
BIN = imagimp
# FLAG
FLAGS = -Wall
# INCLUDES
INC = ./lib/include/
# LIBRARY
LIBDIR = ./lib/
# Librairies
LIBS =  -lglimagimp -lglut -lGL -lGLU
# Compilateur
CC = gcc
# SOURCES
SRC = src/
# OBJETS
OBJECTS = $(SRC)main.o $(SRC)ihm.o $(SRC)image.o $(SRC)calque.o $(SRC)lut.o
# MAIN
#MAIN = $(SRC)main.c

all: $(OBJECTS)
	@echo "**** Compilation finale ****"
	$(CC)  -o ./bin/$(BIN) $(FLAGS) -I$(INC) $(OBJECTS) -L$(LIBDIR) $(LIBS)

$(SRC)%.o: $(SRC)%.c $(SRC)%.h
	@echo "**** $@ ****"
	$(CC) -I$(INC) $(FLAGS) -c $< -o $@

clean:
	@rm -f $(SRC)*.o
	@rm -f bin/$(BIN)
	@find . -name "*~" -exec rm {} \;
	@echo "C'est bien propre ! Monsieur."

